<template>
  <div>
    <!-- 头部选项 -->
    <early-warning-header :innerMenu="innerMenu" />
    <section :class="isAsideFold ? 'section_fold' : 'section_noFold'">
      <!-- 表格 -->
      <early-warning-table
        :innerMenu="innerMenu"
        class="tableContent"
        :class="asideMenuStatus ? '' : 'tableContent_Fold'"
      />
      <!-- 抽屉 -->
      <early-warning-drawer-content class="earlyWarningDrawer" />
    </section>
  </div>
</template>

<script>
import earlyWarningHeader from './cpns/early_warning_header.vue'
import earlyWarningTable from './cpns/early_warning_table.vue'
import earlyWarningDrawerContent from './cpns/earlt_warning_drawerContent.vue'
import { getCacheInnerMenu } from '@/utils/menu'

export default {
  components: {
    earlyWarningHeader,
    earlyWarningTable,
    earlyWarningDrawerContent
  },
  data() {
    return {
      asideMenuStatus: false,
      isAsideFold: true,
      innerMenu: {}
    }
  },
  created() {
    // 监听后台菜单折叠状态
    this.$bus.$on('asideFoldeBtnClick', (status) => {
      this.asideMenuStatus = status
    })
    this.$bus.$on('earlyWarningDrawerId', (status) => {
      this.isAsideFold = false
    })
    this.$bus.$on('drawerBoxStatusChange_earlyWarning', (status) => {
      this.isAsideFold = true
    })
    this.innerMenu = getCacheInnerMenu(this.$route.meta.id)
    // console.log('站点管理权限', this.innerMenu)
  }
}
</script>

<style scoped>
section {
  position: relative;
  display: flex;
}

.section_noFold {
  overflow: visible;
}

.section_fold {
  overflow: hidden;
}

/* .earlyWarningDrawer {} */

.tableContent {
  /* width: 1398px; */
  width: 100%;
}

.tableContent_Fold {
  /* width: 1228px; */
  width: 100%;
}
</style>
